object TEstXunh {
  def main(args: Array[String]): Unit = {
    //循环
    for (i <- 1 to 20) {
      println(i)
    }
    val b = Array("dog", "pig", "banana", "python", "snake")
    b.foreach(print)
    println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
    for (j <- b if j.length > 3) {
      println(s"${j}")
    }
    //    var k=0;不支持
    //    for(k=0;k<b.length;k+=1){
    //
    //    }

    for (i <- 1 to 9; j <- 1 to i) {
      print(s"${i}*${j}=${i * j}\t")
      if (j == i)
        println()
    }
  }
}
